/*   1:    */ package org.jetbrains.generate.tostring.inspection;
/*   2:    */ 
/*   3:    */

import com.intellij.codeInspection.ProblemsHolder;
import com.intellij.psi.JavaElementVisitor;
import com.intellij.psi.PsiElementVisitor;
import com.intellij.util.ui.CheckBox;
import org.jetbrains.annotations.NotNull;

import javax.swing.*;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import javax.swing.text.Document;
import java.awt.*;

/*   4:    */
/*   5:    */
/*   6:    */
/*   7:    */
/*   8:    */
/*   9:    */
/*  10:    */
/*  11:    */
/*  12:    */
/*  13:    */
/*  14:    */
/*  15:    */
/*  16:    */
/*  17:    */
/*  18:    */
/*  19:    */
/*  20:    */
/*  21:    */
/*  22:    */
/*  23:    */
/*  24:    */
/*  25:    */
/*  26:    */
/*  27:    */
/*  28:    */
/*  29:    */
/*  30:    */
/*  31:    */ 
/*  32:    */ public class ClassHasNoToStringMethodInspection
/*  33:    */   extends AbstractToStringInspection
/*  34:    */ {
/*  35: 44 */   public String excludeClassNames = "";
/*  36: 46 */   public boolean excludeException = true;
/*  37: 48 */   public boolean excludeDeprecated = true;
/*  38: 50 */   public boolean excludeEnum = false;
/*  39: 52 */   public boolean excludeAbstract = false;
/*  40: 54 */   public boolean excludeTestCode = false;
/*  41: 56 */   public boolean excludeInnerClasses = false;
/*  42:    */   
/*  43:    */   @NotNull
/*  44:    */   public String getDisplayName()
/*  45:    */   {
/*  46: 61 */     String tmp2_0 = "Class does not override 'toString()' method";
/*  47: 61 */     if (tmp2_0 == null) {
/*  48: 61 */       throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/jetbrains/generate/tostring/inspection/ClassHasNoToStringMethodInspection", "getDisplayName" }));
/*  49:    */     }
/*  50: 61 */     return tmp2_0;
/*  51:    */   }
/*  52:    */   
/*  53:    */   @NotNull
/*  54:    */   public String getShortName()
/*  55:    */   {
/*  56: 67 */     String tmp2_0 = "ClassHasNoToStringMethod";
/*  57: 67 */     if (tmp2_0 == null) {
/*  58: 67 */       throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/jetbrains/generate/tostring/inspection/ClassHasNoToStringMethodInspection", "getShortName" }));
/*  59:    */     }
/*  60: 67 */     return tmp2_0;
/*  61:    */   }
/*  62:    */   
/*  63:    */   @NotNull
/*  64:    */   public PsiElementVisitor buildVisitor(@NotNull final ProblemsHolder paramProblemsHolder, boolean paramBoolean)
/*  65:    */   {
/*  66: 73 */     if (paramProblemsHolder == null) {
/*  67: 73 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/jetbrains/generate/tostring/inspection/ClassHasNoToStringMethodInspection", "buildVisitor" }));
/*  68:    */     }
/*  69: 73 */     void tmp49_46 = new JavaElementVisitor();
/*  70: 73 */     if (tmp49_46 == null) {
/*  71: 73 */       throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/jetbrains/generate/tostring/inspection/ClassHasNoToStringMethodInspection", "buildVisitor" }));
/*  72:    */     }
/*  73: 73 */     return tmp49_46;
/*  74:    */   }
/*  75:    */   
/*  76:    */   public JComponent createOptionsPanel()
/*  77:    */   {
/*  78:163 */     JPanel localJPanel = new JPanel(new GridBagLayout());
/*  79:164 */     GridBagConstraints localGridBagConstraints = new GridBagConstraints();
/*  80:    */     
/*  81:166 */     localGridBagConstraints.gridx = 0;
/*  82:167 */     localGridBagConstraints.gridy = 0;
/*  83:168 */     localGridBagConstraints.weightx = 0.0D;
/*  84:169 */     localGridBagConstraints.anchor = 17;
/*  85:170 */     localGridBagConstraints.fill = 0;
/*  86:171 */     localJPanel.add(new JLabel("Exclude classes (reg exp):"), localGridBagConstraints);
/*  87:    */     
/*  88:173 */     final JTextField localJTextField = new JTextField(this.excludeClassNames, 40);
/*  89:174 */     localJTextField.setMinimumSize(new Dimension(140, 20));
/*  90:175 */     Document localDocument = localJTextField.getDocument();
/*  91:176 */     localDocument.addDocumentListener(new DocumentListener()
/*  92:    */     {
/*  93:    */       public void changedUpdate(DocumentEvent paramAnonymousDocumentEvent)
/*  94:    */       {
/*  95:179 */         a();
/*  96:    */       }
/*  97:    */       
/*  98:    */       public void insertUpdate(DocumentEvent paramAnonymousDocumentEvent)
/*  99:    */       {
/* 100:184 */         a();
/* 101:    */       }
/* 102:    */       
/* 103:    */       public void removeUpdate(DocumentEvent paramAnonymousDocumentEvent)
/* 104:    */       {
/* 105:189 */         a();
/* 106:    */       }
/* 107:    */       
/* 108:    */       private void a()
/* 109:    */       {
/* 110:193 */         ClassHasNoToStringMethodInspection.this.excludeClassNames = localJTextField.getText();
/* 111:    */       }
/* 112:195 */     });
/* 113:196 */     localGridBagConstraints.gridx = 1;
/* 114:197 */     localGridBagConstraints.gridy = 0;
/* 115:198 */     localGridBagConstraints.weightx = 1.0D;
/* 116:199 */     localGridBagConstraints.anchor = 18;
/* 117:200 */     localGridBagConstraints.fill = 0;
/* 118:201 */     localJPanel.add(localJTextField, localGridBagConstraints);
/* 119:    */     
/* 120:203 */     CheckBox localCheckBox1 = new CheckBox("Ignore exception classes", this, "excludeException");
/* 121:204 */     localGridBagConstraints.gridx = 0;
/* 122:205 */     localGridBagConstraints.gridy = 1;
/* 123:206 */     localGridBagConstraints.gridwidth = 2;
/* 124:207 */     localGridBagConstraints.fill = 2;
/* 125:208 */     localJPanel.add(localCheckBox1, localGridBagConstraints);
/* 126:    */     
/* 127:210 */     CheckBox localCheckBox2 = new CheckBox("Ignore deprecated classes", this, "excludeDeprecated");
/* 128:211 */     localGridBagConstraints.gridy = 2;
/* 129:212 */     localJPanel.add(localCheckBox2, localGridBagConstraints);
/* 130:    */     
/* 131:214 */     CheckBox localCheckBox3 = new CheckBox("Ignore enum classes", this, "excludeEnum");
/* 132:215 */     localGridBagConstraints.gridy = 3;
/* 133:216 */     localJPanel.add(localCheckBox3, localGridBagConstraints);
/* 134:    */     
/* 135:218 */     CheckBox localCheckBox4 = new CheckBox("Ignore abstract classes", this, "excludeAbstract");
/* 136:219 */     localGridBagConstraints.gridy = 4;
/* 137:220 */     localJPanel.add(localCheckBox4, localGridBagConstraints);
/* 138:    */     
/* 139:222 */     CheckBox localCheckBox5 = new CheckBox("Ignore test classes", this, "excludeTestCode");
/* 140:223 */     localGridBagConstraints.gridy = 5;
/* 141:224 */     localJPanel.add(localCheckBox5, localGridBagConstraints);
/* 142:    */     
/* 143:226 */     CheckBox localCheckBox6 = new CheckBox("Ignore inner classes", this, "excludeInnerClasses");
/* 144:227 */     localGridBagConstraints.gridy = 6;
/* 145:228 */     localGridBagConstraints.weighty = 1.0D;
/* 146:229 */     localJPanel.add(localCheckBox6, localGridBagConstraints);
/* 147:    */     
/* 148:231 */     return localJPanel;
/* 149:    */   }
/* 150:    */ }



/* Location:           E:\idea\

 * Qualified Name:     org.jetbrains.generate.tostring.inspection.ClassHasNoToStringMethodInspection

 * JD-Core Version:    0.7.0.1

 */